package com.rs.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;

import com.rs.util.TimeTypeConversionUtil;

import io.swagger.annotations.ApiModelProperty;

/**
 * 
 * 描述：项目表
 * 
 * @author：fjc
 * @date 2020年7月8日
 * @version:1.0
 */
public class Project implements Serializable {
	@ApiModelProperty(value = "项目表id")
	private Integer pr_id;//项目表

	@ApiModelProperty(value = "项目名称")
	private String pr_name;//项目名称

	@ApiModelProperty(value = "项目简介")
	private String pr_brief;//项目简介

	@ApiModelProperty(value = "负责人id")
	private Integer pr_uid;//负责人id

	@ApiModelProperty(value = "负责人姓名")
	private String pr_uname;//负责人姓名

	@ApiModelProperty(value = "开始时间")
	private Date pr_ktime;//开始时间

	@ApiModelProperty(value = "项目天数")
	private Double pr_days;//项目天数（天）

	@ApiModelProperty(value = "项目进度")
	private Integer pr_schedule;//项目进度

	@ApiModelProperty(value = "项目状态（0：立项，1：执行，2：交付，3.延期，4.中止）")
	private Integer pr_post;//项目状态（0：立项，1：执行，2：交付，3.延期，4.中止）

	@ApiModelProperty("修改人的用户id")
	private Integer pr_upuid;//修改人的用户id

	@ApiModelProperty("当前页数")
	private Integer pageNum;//当前页数

	private Relation[] relations;//项目-人员关系对象

	private static final long serialVersionUID = 1L;

	//转为数组
	public Object[] toObjects(int leng) {
		Object[] ary = new Object[leng];

		ary[0] = pr_id;

		ary[1] = pr_name;

		ary[2] = pr_uname;

		ary[3] = TimeTypeConversionUtil.getStringDate(pr_ktime);

		ary[4] = pr_days;

		switch (pr_post) {
		case 0:
			ary[5] = "立项";
			break;
		case 1:
			ary[5] = "执行";
			break;
		case 2:
			ary[5] = "交付";
			break;
		case 3:
			ary[5] = "延期";
			break;

		case 4:
			ary[5] = "中止";
			break;

		}

		ary[6] = "查看";

		return ary;
	}

	public Integer getPr_id() {
		return pr_id;
	}

	public void setPr_id(Integer pr_id) {
		this.pr_id = pr_id;
	}

	public String getPr_name() {
		return pr_name;
	}

	public void setPr_name(String pr_name) {
		this.pr_name = pr_name;
	}

	public String getPr_brief() {
		return pr_brief;
	}

	public void setPr_brief(String pr_brief) {
		this.pr_brief = pr_brief;
	}

	public Integer getPr_uid() {
		return pr_uid;
	}

	public void setPr_uid(Integer pr_uid) {
		this.pr_uid = pr_uid;
	}

	public String getPr_uname() {
		return pr_uname;
	}

	public void setPr_uname(String pr_uname) {
		this.pr_uname = pr_uname;
	}

	public Date getPr_ktime() {
		return pr_ktime;
	}

	public void setPr_ktime(Date pr_ktime) {
		this.pr_ktime = pr_ktime;
	}

	public Double getPr_days() {
		return pr_days;
	}

	public void setPr_days(Double pr_days) {
		this.pr_days = pr_days;
	}

	public Integer getPr_schedule() {
		return pr_schedule;
	}

	public void setPr_schedule(Integer pr_schedule) {
		this.pr_schedule = pr_schedule;
	}

	public Integer getPr_post() {
		return pr_post;
	}

	public void setPr_post(Integer pr_post) {
		this.pr_post = pr_post;
	}

	public Integer getPr_upuid() {
		return pr_upuid;
	}

	public void setPr_upuid(Integer pr_upuid) {
		this.pr_upuid = pr_upuid;
	}

	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public Relation[] getRelations() {
		return relations;
	}

	public void setRelations(Relation[] relations) {
		this.relations = relations;
	}

	@Override
	public String toString() {
		return "Project [pr_id=" + pr_id + ", pr_name=" + pr_name + ", pr_brief=" + pr_brief + ", pr_uid=" + pr_uid
				+ ", pr_uname=" + pr_uname + ", pr_ktime=" + pr_ktime + ", pr_days=" + pr_days + ", pr_schedule="
				+ pr_schedule + ", pr_post=" + pr_post + ", pr_upuid=" + pr_upuid + ", pageNum=" + pageNum
				+ ", relations=" + Arrays.toString(relations) + "]";
	}

}